'use strict'

/**
 * 实用工具类模块
 */

module.exports = ({ router, controller, io, config }) => {
  const NAMESPACE = `${config.apiPath}/common`
  const subRouter = router.namespace(NAMESPACE)
  const Post = subRouter.post

  const { socket } = io.controller

  io.of('/').route('chat', socket.socket)
  io.route('disconnect', socket.disconnect)
  io.route('chat', socket.ping)

  Post('/send_notify', socket.testData)
}
